<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .btnner {
        position: fixed;
        top: 20px;
        left: 250px;
      }
      .erweima {
        width: 200px;
        height: 200px;
        background-color: pink;
      }
      .hide {
        display: none;
      }
      .show {
        display: block;
      }
    </style>
  </head>
  <body>
    <script src="common.js"></script>
    <div class="erweima show" id="er"></div>
    <input id="btn" type="button" value="点击隐藏" class="btnner" />
    <script>
      var btn = my$("btn");
      var er = my$("er");
      btn.onclick = function () {
        if (btn.value == "点击隐藏") {
          er.className = er.className.replace("show", "hide");
          btn.value = "点击显示";
        } else if (btn.value == "点击显示") {
          er.className = er.className.replace("hide", "show");
          btn.value = "点击隐藏";
        }
      };
    </script>
  </body>
</html>
